import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.ws.WebFault;
import java.io.IOException;

@WebServlet("/hello")
public class Hello extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      //        super.doGet(req, resp);//这个代码一定要干掉．父类里的这个方法只是返回了一个错误页面 405
        //在服务器的控制台里打印hello world
//        System.out.println("hello world!(控制台)");
        //要想把hello world 返回到客户端里,需要使用下面代码
        String s = null;
        System.out.println(s.length());
        //getwrite会得到一个write对象
        resp.getWriter().write("hello world!(页面)");
    }
}
